package com.chen.cloudpicture.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.chen.cloudpicture.model.dto.user.UserQueryRequest;
import com.chen.cloudpicture.model.entity.User;
import com.baomidou.mybatisplus.extension.service.IService;
import com.chen.cloudpicture.model.vo.LoginUserVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author 25480
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2025-07-24 21:53:36
*/
public interface UserService extends IService<User> {

    /**
     * 用户注册
     */
    long userRegister(String userAccount, String userPassword, String checkPassword);

    /**
     * 密码加密
     */
    String getEncryptPassword(String userPassword);

    /**
     * 用户登录
     */
    LoginUserVO userLogin(String userAccount, String userPassword, HttpServletRequest request);

    /**
     * 获取当前登录用户
     */
    User getLoginUser(HttpServletRequest request);

    /**
     * 用户退出登录
     */
    boolean userLogout(HttpServletRequest request);

    /**
     * 获取查询条件
     */
    QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);

    /**
     * 判断是否为管理员
     *
     * @param user
     * @return
     */
    boolean isAdmin(User user);


}
